function TbBrandStory(params){ 
	 
}

TbBrandStory.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbBrandStory.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbBrandStory.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbBrandStory.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbbsId=function(tbbsId){if(this.proxy)return this.getProxy().tbbsId(tbbsId);  this.put("tbbsId", tbbsId);return this;};
	/** and tbbs_id is null */
	this.tbbsIdNull=function(){if(this.proxy)return this.getProxy().tbbsIdNull();if(this.get("tbbsIdNot")==null)this.put("tbbsIdNot", "");this.put("tbbsId", null);return this;};
	/** not .... */
	this.tbbsIdNot=function(){if(this.proxy)return this.getProxy().tbbsIdNot();this.put("tbbsIdNot", "not");return this;};
	this.tbbsIdNotNull=function(){if(this.proxy)return this.getProxy().tbbsIdNotNull();this.put("tbbsIdNot", "not");this.put("tbbsId", null);return this;};
	this.tbbsIdNot=function(tbbsId){if(this.proxy)return this.getProxy().tbbsIdNot(tbbsId);this.put("tbbsIdNot", "not");this.put("tbbsId", tbbsId);return this;};
	/** and tbbs_id <= ? */
	this.tbbsIdMin=function(min){if(this.proxy)return this.getProxy().tbbsIdMin(min);this.put("tbbsIdMin", min);return this;};
	/** and tbbs_id >= ? */
	this.tbbsIdMax=function(max){if(this.proxy)return this.getProxy().tbbsIdMax(max);this.put("tbbsIdMax", max);return this;};
	this.tbbsIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsIdIn(ids);  this.put("tbbsIdIn", ids);return this;
	};	
	
	/** 品牌信息  [Merchant]      **/
	this.tbbsBrand=function(tbbsBrand){if(this.proxy)return this.getProxy().tbbsBrand(tbbsBrand);  this.put("tbbsBrand", tbbsBrand);return this;};
	/** and tbbs_brand is null */
	this.tbbsBrandNull=function(){if(this.proxy)return this.getProxy().tbbsBrandNull();if(this.get("tbbsBrandNot")==null)this.put("tbbsBrandNot", "");this.put("tbbsBrand", null);return this;};
	/** not .... */
	this.tbbsBrandNot=function(){if(this.proxy)return this.getProxy().tbbsBrandNot();this.put("tbbsBrandNot", "not");return this;};
	this.tbbsBrandNotNull=function(){if(this.proxy)return this.getProxy().tbbsBrandNotNull();this.put("tbbsBrandNot", "not");this.put("tbbsBrand", null);return this;};
	this.tbbsBrandNot=function(tbbsBrand){if(this.proxy)return this.getProxy().tbbsBrandNot(tbbsBrand);this.put("tbbsBrandNot", "not");this.put("tbbsBrand", tbbsBrand);return this;};
	this.tbbsBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbbsBrandIn(ids);  this.put("tbbsBrandIn", ids);return this;
	};	
	
	/** 内容        **/
	this.tbbsContent=function(tbbsContent){if(this.proxy)return this.getProxy().tbbsContent(tbbsContent);  this.put("tbbsContent", tbbsContent);return this;};
	/** and tbbs_content is null */
	this.tbbsContentNull=function(){if(this.proxy)return this.getProxy().tbbsContentNull();if(this.get("tbbsContentNot")==null)this.put("tbbsContentNot", "");this.put("tbbsContent", null);return this;};
	/** not .... */
	this.tbbsContentNot=function(){if(this.proxy)return this.getProxy().tbbsContentNot();this.put("tbbsContentNot", "not");return this;};
	this.tbbsContentNotNull=function(){if(this.proxy)return this.getProxy().tbbsContentNotNull();this.put("tbbsContentNot", "not");this.put("tbbsContent", null);return this;};
	this.tbbsContentNot=function(tbbsContent){if(this.proxy)return this.getProxy().tbbsContentNot(tbbsContent);this.put("tbbsContentNot", "not");this.put("tbbsContent", tbbsContent);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有品牌故事 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/business/brandstory.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取品牌故事分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/business/brandstory.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取品牌故事 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/business/brandstory.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbBrandStory.get = function(id){
	var protocol = ux.ajax("/admin/business/brandstory.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbBrandStory;
	return null;
}

TbBrandStory.where = new TbBrandStory.Where(0,true);